<html>

<head>
    <meta charset="utf-8">
    <meta name="author" content="lz">
    <script src="jQuery/jquery-3.1.1.js"></script>
    <title></title>
    <style>
        ul,
        li {
            margin: 0;
            padding: 0;
            list-style: none;
        }
        
        #box {
            width: 520px;
            height: 280px;
            margin: 100px auto;
            position: relative;
        }
        
        #box .list li {
            position: absolute;
            top: 0;
            left: 0;
            display: none;
        }
        
        #box .list li.current {
            display: block;
        }
        
        #box .count {
            position: absolute;
            right: 10px;
            bottom: 10px;
        }
        
        #box .count li {
            float: left;
            width: 20px;
            height: 20px;
            border-radius: 50%;
            background-color: #fa0;
            text-align: center;
            line-height: 20px;
            margin-left: 10px;
            color: white;
            opacity: 0.8;
            cursor: pointer;
        }
        
        #box .count li.current {
            background-color: #f60;
            opacity: 1;
        }
        
        .aj1,
        .aj2 {
            width: 40px;
            height: 20px;
            background-color: #f60;
            display: inline-block;
            text-align: center;
            font-size: 1.2em;
            line-height: 20px;
            cursor: pointer;
        }
        .aj{
            position: absolute;
            bottom: 10px;
            left: 10px;
        }
    </style>
</head>

<body>
    <div id="box">
        <ul class="list">
            <li class="current"><img src="img/01.jpg" alt=""></li>
            <li><img src="img/02.jpg" alt=""></li>
            <li><img src="img/03.jpg" alt=""></li>
            <li><img src="img/04.jpg" alt=""></li>
            <li><img src="img/05.jpg" alt=""></li>
        </ul>
        <ul class="count">
            <li class="current">1</li>
            <li>2</li>
            <li>3</li>
            <li>4</li>
            <li>5</li>
        </ul>
        <div class="aj">
            <div class="aj1"><</div>
             <div class="aj2">></div>
            </div>
        </div>

</body>

</html>
<script>
    var box = $('#box')
    var ali = $('.list li')
    var anum = $('.count li')
    var current = 0;
    var timer = null;

    timer = setInterval(aplay, 1000);
    function aplay() {
        current++;
        if (current >= ali.length) {
            current = 0;
        }
        show(current);
    }

    anum.each(function (index) {
        anum.eq(index).mouseenter(function () {
            show(index);
        })
    })

    function show(index) {
        current = index;
        ali.each(function () {
            ali.eq(index).css('display', 'block').siblings().css('display', 'none');
            anum.eq(index).addClass('current').siblings().removeClass('current');
        })
    }
    box.mouseenter(function () {
        clearInterval(timer);
    })
    box.mouseleave(function () {
        timer = setInterval(aplay, 1000);
    })

    $('.aj1').click(function(){
        current--;
        show(current);
    })
     $('.aj2').click(function(){
        current++;
        show(current);
    })

</script>